package com.xiaolun.transferValue;

public class TransferValueDemo01 {
	public void changeVlue(int age){
	    age = 30;
	}
	public void changeValue2(Person person){
		person.setPersonname("xxx");
	}
	public void changeValue3(String str){
		str = "xxx";
	}

	public static void main(String[] args) {
		TransferValueDemo01 test = new TransferValueDemo01();
		int age = 20;
		test.changeVlue(age);
		//age --> 20
		System.out.println("age --> " + age);

		Person person = new Person("abc");
		test.changeValue2(person);
		//personname --> xxx（引用的值改变了）
		System.out.println("personname --> " + person.getPersonname());
		
		String str = "abc";
		test.changeValue3(str);
		System.out.println("string --> " + str); //string --> abc
	}
}
